###############################################
# === xenomorph_branch_office_buildings_updated.txt ===
###############################################
###############################################
# XENOMORPH BRANCH OFFICE BUILDINGS
# Split from xenomorph_buildings_combined.txt.
###############################################

@b1_time = 360
@b2_time = 720
@b3_time = 1080

building_xenomorph_infestation_relay = {
	base_buildtime = @b1_time
	category = unity
	branch_office_building = yes
	base_cap_amount = 1

	building_sets = {
		government
		urban
		unity
	}

	potential = {
		exists = owner
		owner = {
			is_gestalt = no
			any_owned_species = { has_trait = trait_xenomorph }
		}
	}

	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = yes } }
		job_xenomorph_pheromone_drone_gestalt_add = 100
	}
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = no } }
		job_xenomorph_pheromone_drone_add = 100
	}

	planet_modifier = {
		planet_stability_add = -3
	}

	resources = {
		category = planet_branch_office_buildings
		cost = {
			food = 400
			xenomorph_eggs = 10
			xenomorph_offspring = 25
		}
		upkeep = { food = 2 }
	}
}


building_xenomorph_specimen_acquisition = {
	base_buildtime = @b1_time
	category = research
	branch_office_building = yes
	base_cap_amount = 1

	building_sets = {
		government
		urban
		research
	}

	potential = {
		exists = owner
		owner = {
			is_gestalt = no
			any_owned_species = { has_trait = trait_xenomorph }
		}
	}

	# Branch-office version of captive specimen research, using the new non-duplicate slave research job.
	planet_modifier = {
		job_xenomorph_specimen_thrall_add = 60
		planet_stability_add = -1
	}

	resources = {
		category = planet_branch_office_buildings
		cost = {
			food = 400
			energy = 200
			xenomorph_eggs = 15
			xenomorph_offspring = 40
		}
		upkeep = { energy = 2 food = 2 }
	}
}





###############################################
# === xenomorph_queen_buildings.txt ===
###############################################
###############################################
# XENOMORPH QUEEN BUILDINGS (non-hive empires)
#
# Buildings that exploit captive Xenomorph QUEENS for egg production.
# Two flavours of the same role, so empires can lean tactical or thematic:
#
#  - Royal Egg Chamber (TACTICAL): a stripped-down, efficient industrial
#    operation. Maximum egg yield, minimal frills.
#  - Brood Matron's Bower (FLAVORFUL): an LV-inspired establishment that
#    pampers its captive queens, producing eggs alongside trade and amenities.
#
# Both require tech_xeno_husbandry and a captive Xenomorph present.
###############################################

@qb_time = 540

# --- ROYAL EGG CHAMBER (tactical: pure egg output) ---
building_xeno_royal_egg_chamber = {
	icon = building_clone_vats
	base_buildtime = @qb_time
	category = manufacturing

	building_sets = {
		urban
	}

	potential = {
		exists = owner
		owner = { is_gestalt = no }
		owner = { has_technology = tech_xeno_husbandry }
	}
	allow = {
		any_owned_pop_group = { is_xenomorph = yes }
	}
	destroy_trigger = {
		exists = owner
		owner = { is_gestalt = yes }
	}

	planet_modifier = {
		job_xeno_captive_queen_add = 50
		job_xeno_brood_specimen_add = 100
	}

	resources = {
		category = planet_buildings
		cost = { minerals = 700 alloys = 150 }
		upkeep = { energy = 6 food = 3 }
	}

	upgrades = { building_xeno_grand_hatchery }
}

# --- GRAND HATCHERY (tactical upgrade: more queens, more eggs) ---
building_xeno_grand_hatchery = {
	icon = building_clone_vats
	base_buildtime = @qb_time
	category = manufacturing

	building_sets = {
		urban
	}

	potential = {
		exists = owner
		owner = { is_gestalt = no }
		owner = { has_technology = tech_xeno_warrior_conscription }
	}
	allow = {
		any_owned_pop_group = { is_xenomorph = yes }
	}
	destroy_trigger = {
		exists = owner
		owner = { is_gestalt = yes }
	}

	planet_modifier = {
		job_xeno_captive_queen_add = 50
		job_xeno_brood_specimen_add = 150
	}

	resources = {
		category = planet_buildings
		cost = { minerals = 1200 alloys = 300 }
		upkeep = { energy = 10 food = 5 }
	}
}

# --- BROOD MATRON'S BOWER (flavorful: eggs + trade + amenities) ---
# LV-inspired: the captive queen is kept in indulgent comfort, her
# contentment turned to the empire's profit as well as her fertility.
building_xeno_brood_matrons_bower = {
	icon = building_clone_vats
	base_buildtime = @qb_time
	category = amenity

	building_sets = {
		urban
	}

	potential = {
		exists = owner
		owner = { is_gestalt = no }
		owner = { has_technology = tech_xeno_husbandry }
	}
	allow = {
		any_owned_pop_group = { is_xenomorph = yes }
	}
	destroy_trigger = {
		exists = owner
		owner = { is_gestalt = yes }
	}

	planet_modifier = {
		job_xeno_captive_queen_add = 50
		job_xeno_pleasure_handler_add = 50
		planet_amenities_add = 10
	}

	resources = {
		category = planet_buildings
		cost = { minerals = 600 consumer_goods = 100 }
		upkeep = { energy = 5 consumer_goods = 2 }
	}
}

###############################################
# === xenomorph_slave_sex_buildings.txt ===
###############################################
###############################################
# XENOMORPH SLAVE / SEX / HOST BUILDINGS
# Pass 20 redesign: 4 chains x 3 tiers + 2 standalone = 14 buildings.
#
# Chain 1 - OFFSPRING (slave breeding for xenomorph_offspring resource):
#   T1 Oviposition Chamber -> T2 Broodmare Pens -> T3 Royal Broodstock Hive
#
# Chain 2 - HOST IMPLANTATION (implanting hosts -> offspring + research):
#   T1 Host Processing -> T2 Breeding Pit -> T3 Apex Breeding Hive
#
# Chain 3 - SLAVE RESEARCH (slave brainpower):
#   T1 Host Observation Pens -> T2 Neural Harvest Alcoves -> T3 Apex Specimen Vault
#
# Chain 4 - SLAVE INDUSTRY (slave labor for minerals/alloys):
#   T1 Resin Labor Pits -> T2 Refined Resin Smelter -> T3 Apex Resin Forge
#
# Standalone (no chain):
#   Pheromone Conditioning (amenity / pacification)
#   Hunt Arena (amenity / recreation)
#
# All buildings: base_cap_amount = 1, T1 buildable, T2/T3 tech-gated.
# Scaling: T1 = 100 jobs, T2 = 200 jobs, T3 = 400 jobs (vanilla scale).
###############################################

@b1_time = 360
@b2_time = 720
@b3_time = 1080


#################################################################
# CHAIN 1 - OFFSPRING (slave breeding; available to all Xenomorph hives)
#################################################################

# T1 Oviposition Chamber
building_xenomorph_oviposition_chamber = {
	base_buildtime = @b1_time
	category = manufacturing
	base_cap_amount = 1
	prerequisites = { tech_xenomorph_oviposition_chamber }

	building_sets = {
		government
		urban
		farming
	}

	potential = {
		exists = owner
		owner = {
			xeno_is_xenomorph_hive_country = yes
		}
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
	}

	planet_modifier = {
		job_xenomorph_broodmother_slave_add = 100
		planet_stability_add = -2
	}

	resources = {
		category = planet_buildings
		cost = { food = 400 minerals = 100 }
		upkeep = { food = 2 energy = 2 }
	}

	upgrades = { building_xenomorph_broodmare_pens }
}


# T2 Broodmare Pens
building_xenomorph_broodmare_pens = {
	base_buildtime = @b2_time
	category = manufacturing
	base_cap_amount = 1
	can_build = no
	prerequisites = { tech_xenomorph_broodmare_pens }

	building_sets = {
		government
		urban
		farming
	}

	potential = {
		exists = owner
		owner = {
			xeno_is_xenomorph_hive_country = yes
			OR = {
				has_country_flag = xenomorph_breeding_pits_unlocked
			}
		}
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
		}
	}

	planet_modifier = {
		job_xenomorph_broodmare_thrall_add = 200
		planet_amenities_add = 250
		planet_stability_add = -4
	}

	resources = {
		category = planet_buildings
		cost = { food = 600 minerals = 200 exotic_gases = 25 }
		upkeep = { food = 5 energy = 3 xenomorph_offspring = 1 }
	}

	upgrades = { building_xenomorph_royal_broodstock_hive }
}


# T3 Royal Broodstock Hive (NEW)
building_xenomorph_royal_broodstock_hive = {
	base_buildtime = @b3_time
	category = manufacturing
	base_cap_amount = 1
	can_build = no
	prerequisites = { tech_xenomorph_royal_broodstock_hive }

	building_sets = {
		government
		urban
		farming
	}

	potential = {
		exists = owner
		owner = {
			xeno_is_xenomorph_hive_country = yes
			OR = {
				has_country_flag = xenomorph_breeding_pits_upgraded
			}
		}
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
		}
	}

	planet_modifier = {
		job_xenomorph_broodmother_slave_add = 200
		job_xenomorph_broodmare_thrall_add = 200
		planet_amenities_add = 500
		planet_stability_add = -6
	}

	resources = {
		category = planet_buildings
		cost = { food = 800 minerals = 300 exotic_gases = 50 rare_crystals = 25 }
		upkeep = { food = 8 energy = 4 xenomorph_offspring = 2 rare_crystals = 1 }
	}
}


#################################################################
# CHAIN 2 - HOST IMPLANTATION
#################################################################

# T1 Host Processing
building_xenomorph_host_processing = {
	icon = building_research_lab_1
	base_buildtime = @b1_time
	category = resource
	base_cap_amount = 1

	building_sets = {
		government
		urban
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = yes } }
		job_xenomorph_implantation_drone_gestalt_add = 100
	}
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = no } }
		job_xenomorph_implantation_drone_add = 100
	}

	planet_modifier = {
		planet_stability_add = -2
		pop_purge_speed = 0.15
	}

	resources = {
		category = planet_buildings
		cost = { food = 400 minerals = 100 }
		upkeep = { food = 2 energy = 2 }
	}

	upgrades = { building_xenomorph_breeding_pit }
}


# T2 Breeding Pit
building_xenomorph_breeding_pit = {
	base_buildtime = @b2_time
	category = manufacturing
	base_cap_amount = 1
	can_build = no
	prerequisites = { tech_xenomorph_breeding_pit }

	building_sets = {
		government
		urban
		farming
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
		planet = { num_pops >= 12 }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = yes } }
		job_xenomorph_pit_warden_gestalt_add = 200
		job_xenomorph_broodmother_slave_add = 100
	}
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = no } }
		job_xenomorph_pit_warden_add = 200
	}

	planet_modifier = {
		planet_stability_add = -5
		pop_purge_speed = 0.35
	}

	resources = {
		category = planet_buildings
		cost = { food = 600 minerals = 200 exotic_gases = 25 }
		upkeep = { food = 5 energy = 3 xenomorph_offspring = 1 }
	}

	upgrades = { building_xenomorph_apex_breeding_hive }
}


# T3 Apex Breeding Hive (NEW)
building_xenomorph_apex_breeding_hive = {
	base_buildtime = @b3_time
	category = manufacturing
	base_cap_amount = 1
	can_build = no
	prerequisites = { tech_xenomorph_apex_breeding_hive }

	building_sets = {
		government
		urban
		farming
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
		planet = { num_pops >= 12 }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = yes } }
		job_xenomorph_pit_warden_gestalt_add = 400
		job_xenomorph_broodmother_slave_add = 200
	}
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = no } }
		job_xenomorph_pit_warden_add = 400
	}

	planet_modifier = {
		planet_stability_add = -8
		planet_crime_add = 10
		pop_purge_speed = 0.60
	}

	resources = {
		category = planet_buildings
		cost = { food = 800 minerals = 400 exotic_gases = 50 rare_crystals = 25 }
		upkeep = { food = 8 energy = 5 xenomorph_offspring = 2 rare_crystals = 1 }
	}
}


#################################################################
# CHAIN 3 - SLAVE RESEARCH
#################################################################

# T1 Host Observation Pens
building_xenomorph_host_observation_pens = {
	icon = building_research_lab_1
	base_buildtime = @b1_time
	category = research
	base_cap_amount = 1
	prerequisites = { tech_xenomorph_host_observation_protocols }

	building_sets = {
		government
		urban
		research
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	planet_modifier = {
		job_xenomorph_specimen_thrall_add = 60
		planet_stability_add = -1
	}

	resources = {
		category = planet_buildings
		cost = { food = 400 energy = 200 }
		upkeep = { food = 2 energy = 2 }
	}

	upgrades = { building_xenomorph_neural_harvest_alcoves }
}


# T2 Neural Harvest Alcoves
building_xenomorph_neural_harvest_alcoves = {
	icon = building_hive_node
	base_buildtime = @b2_time
	category = research
	base_cap_amount = 1
	can_build = no
	prerequisites = { tech_xenomorph_neural_harvesting }

	building_sets = {
		government
		urban
		research
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	planet_modifier = {
		job_xenomorph_synaptic_battery_add = 120
		planet_stability_add = -3
	}

	resources = {
		category = planet_buildings
		cost = { food = 600 energy = 400 exotic_gases = 25 }
		upkeep = { food = 5 energy = 4 xenomorph_offspring = 1 }
	}

	upgrades = { building_xenomorph_apex_specimen_vault }
}


# T3 Apex Specimen Vault (NEW)
building_xenomorph_apex_specimen_vault = {
	base_buildtime = @b3_time
	category = research
	base_cap_amount = 1
	can_build = no
	prerequisites = { tech_xenomorph_apex_specimen_vault }

	building_sets = {
		government
		urban
		research
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	planet_modifier = {
		job_xenomorph_specimen_thrall_add = 200
		job_xenomorph_synaptic_battery_add = 200
		planet_stability_add = -5
	}

	resources = {
		category = planet_buildings
		cost = { food = 800 energy = 600 exotic_gases = 50 rare_crystals = 25 }
		upkeep = { food = 8 energy = 5 xenomorph_offspring = 2 rare_crystals = 1 }
	}
}


#################################################################
# CHAIN 4 - SLAVE INDUSTRY
#################################################################

# T1 Resin Labor Pits
building_xenomorph_resin_labor_pits = {
	base_buildtime = @b1_time
	category = resource
	base_cap_amount = 1
	prerequisites = { tech_xenomorph_resin_labor_conditioning }

	building_sets = {
		government
		urban
		industrial
		mining
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	planet_modifier = {
		job_xenomorph_resin_thrall_add = 100
	}

	resources = {
		category = planet_buildings
		cost = { food = 400 minerals = 300 }
		upkeep = { food = 2 }
	}

	upgrades = { building_xenomorph_refined_resin_smelter }
}


# T2 Refined Resin Smelter (NEW)
building_xenomorph_refined_resin_smelter = {
	icon = building_hive_node
	base_buildtime = @b2_time
	category = resource
	base_cap_amount = 1
	can_build = no
	prerequisites = { tech_xenomorph_refined_resin_smelter }

	building_sets = {
		government
		urban
		industrial
		mining
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	planet_modifier = {
		job_xenomorph_resin_thrall_add = 200
		planet_jobs_alloys_produces_mult = 0.05
	}

	resources = {
		category = planet_buildings
		cost = { food = 600 minerals = 500 exotic_gases = 25 }
		upkeep = { food = 5 energy = 2 xenomorph_offspring = 1 }
	}

	upgrades = { building_xenomorph_apex_resin_industrial_forge }
}


# T3 Apex Resin Industrial Forge (NEW)
building_xenomorph_apex_resin_industrial_forge = {
	base_buildtime = @b3_time
	category = resource
	base_cap_amount = 1
	can_build = no
	prerequisites = { tech_xenomorph_apex_resin_industrial_forge }

	building_sets = {
		government
		urban
		industrial
		mining
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	planet_modifier = {
		job_xenomorph_resin_thrall_add = 400
		planet_jobs_alloys_produces_mult = 0.10
		planet_jobs_minerals_produces_mult = 0.05
	}

	resources = {
		category = planet_buildings
		cost = { food = 800 minerals = 800 exotic_gases = 50 rare_crystals = 25 }
		upkeep = { food = 8 energy = 4 xenomorph_offspring = 2 rare_crystals = 1 }
	}
}


#################################################################
# STANDALONE - Pheromone Conditioning (amenity / pacification)
#################################################################

building_xenomorph_pheromone_conditioning = {
	base_buildtime = @b1_time
	category = amenity
	base_cap_amount = 1

	building_sets = {
		government
		urban
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = yes } }
		job_xenomorph_pheromone_drone_gestalt_add = 100
	}
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = no } }
		job_xenomorph_pheromone_drone_add = 100
	}

	planet_modifier = {
		planet_stability_add = 5
		planet_crime_add = -10
	}

	resources = {
		category = planet_buildings
		cost = { food = 400 }
		upkeep = { food = 2 energy = 1 }
	}
}


#################################################################
# STANDALONE - Hunt Arena (amenity / recreation)
#################################################################

building_xenomorph_hunt_arena = {
	icon = building_lv_brothel
	base_buildtime = @b1_time
	category = amenity
	base_cap_amount = 1

	building_sets = {
		government
		urban
		entertainment
	}

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}

	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	planet_modifier = {
		job_xenomorph_pit_plaything_add = 100
		planet_amenities_add = 200
		planet_stability_add = 1
	}

	resources = {
		category = planet_buildings
		cost = { food = 400 }
		upkeep = { food = 2 energy = 1 }
	}
}

# ============================================================
# Host Conditioning Chamber - slave-processing equivalent (reduces slave political power)
# ============================================================
building_xenomorph_host_conditioning = {
	icon = building_research_lab_1
	base_buildtime = @b1_time
	category = government
	base_cap_amount = 1

	building_sets = { government urban }

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}
	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}
	planet_modifier = {
		pop_political_power = -0.30
		planet_stability_add = 3
	}
	resources = {
		category = planet_buildings
		cost = { food = 400 minerals = 75 }
		upkeep = { energy = 2 }
	}
}

# ============================================================
# XENOMORPH OFFSPRING PRODUCTION CHAIN (Xeno-only, nonlethal)
# ============================================================
building_xenomorph_pleasure_warren = {
	icon = building_lv_brothel
	base_buildtime = @b1_time
	category = unity
	building_sets = { government urban }

	potential = {
		exists = owner
		has_global_flag = lustful_void_mod_loaded
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = yes }
	}
	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { has_global_flag = lustful_void_mod_loaded }
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
		}
	}

	# Replaces the Lustful Void Masturbation Node for Xeno hives. Standalone pleasure building (hive variants).
	triggered_planet_modifier = {
		potential = { owner = { NOT = { has_ascension_perk = ap_mind_over_matter } } }
		modifier = {
			job_lv_pleasure_drone_add = 100
		}
	}
	triggered_planet_modifier = {
		potential = { owner = { has_ascension_perk = ap_mind_over_matter } }
		modifier = {
			job_lv_pleasure_drone_add = 50
			job_lv_psi_pleasure_drone_add = 50
		}
	}

	resources = {
		category = planet_buildings
		cost = { minerals = @b1_minerals }
		upkeep = { energy = @b1_upkeep }
	}
}

building_xenomorph_self_seeding_brood_hive = {
	icon = building_hive_node
	base_buildtime = @b2_time
	category = pop_assembly
	base_cap_amount = 1
	prerequisites = { tech_xenomorph_self_seeding_brood_hive }
	building_sets = { government urban farming }
	upgrades = { building_xenomorph_autogenic_breeding_warren }

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = yes }
	}
	destroy_trigger = {
		exists = owner
		NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
	}

	# Standalone Xenomorph self-breeding building (no slaves). Research-gated.
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = yes } }
		modifier = {
			job_xenomorph_self_seeding_brood_layer_gestalt_add = 200
		}
	}
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = no } }
		modifier = {
			job_xenomorph_self_seeding_brood_layer_add = 200
		}
	}

	planet_modifier = {
		logistic_growth_mult = 0.2
	}

	resources = {
		category = planet_buildings
		cost = { food = 600 minerals = 150 }
		upkeep = { food = 4 energy = 2 }
	}
}


# Pleasure-Compliance Den: Xenomorph-hive analogue of vanilla building_slave_processing (neural implants chain).
building_xenomorph_pleasure_compliance_den = {
	icon = building_lv_brothel
	base_buildtime = @b1_time
	category = government
	base_cap_amount = 1
	prerequisites = { "tech_xenomorph_pleasure_compliance_conditioning" }
	building_sets = { government urban }

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		any_owned_pop_group = { is_xenomorph = no }
	}
	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { any_owned_pop_group = { is_xenomorph = no } }
		}
	}

	# Mimics building_slave_processing effects (slave-management modifiers, no jobs).
	planet_modifier = {
		pop_slave_bonus_workforce_mult = 0.10
		pop_slave_political_power = -0.25
		planet_resettlement_unemployed_mult = -0.50
	}

	resources = {
		category = planet_buildings
		cost = { minerals = @b1_minerals }
		upkeep = { energy = 2 }
	}
}


# === Autogenic Brood chain T2: Autogenic Breeding Warren (upgrade of Self-Seeding Brood Hive) ===
# Gated by Autogenic Brood tradition pick "Royal Brood Warrens".
building_xenomorph_autogenic_breeding_warren = {
	icon = building_clone_vats
	base_buildtime = @b2_time
	category = pop_assembly
	base_cap_amount = 1
	prerequisites = { tech_xenomorph_self_seeding_brood_hive }
	building_sets = { government urban farming }
	upgrades = { building_xenomorph_royal_self_breeding_hive }

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		owner = { has_tradition = tr_xenomorph_autogenic_brood_royal_brood_warrens }
		any_owned_pop_group = { is_xenomorph = yes }
	}
	destroy_trigger = {
		exists = owner
		NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
	}

	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = yes } }
		modifier = {
			job_xenomorph_self_seeding_brood_layer_gestalt_add = 200
			job_xenomorph_womb_seeding_carrier_gestalt_add = 100
		}
	}
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = no } }
		modifier = {
			job_xenomorph_self_seeding_brood_layer_add = 200
			job_xenomorph_womb_seeding_carrier_add = 100
		}
	}

	planet_modifier = {
		logistic_growth_mult = 0.25
		planet_pop_assembly_organic_add = 1
	}

	resources = {
		category = planet_buildings
		cost = { food = 900 minerals = 250 }
		upkeep = { food = 6 energy = 3 }
	}
}

# === Autogenic Brood chain T3: Royal Self-Breeding Hive (upgrade of Autogenic Breeding Warren) ===
# Gated by Apex Autogenic Brood ascension perk. Capstone tier.
building_xenomorph_royal_self_breeding_hive = {
	icon = building_clone_vats
	base_buildtime = @b2_time
	category = pop_assembly
	base_cap_amount = 1
	prerequisites = { tech_xenomorph_self_seeding_brood_hive }
	building_sets = { government urban farming }

	potential = {
		exists = owner
		owner = { xeno_is_xenomorph_hive_country = yes }
		owner = { has_ascension_perk = ap_xenomorph_apex_autogenic_brood }
		any_owned_pop_group = { is_xenomorph = yes }
	}
	destroy_trigger = {
		exists = owner
		NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
	}

	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = yes } }
		modifier = {
			job_xenomorph_womb_seeding_carrier_gestalt_add = 100
			job_xenomorph_royal_womb_brood_gestalt_add = 100
		}
	}
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = no } }
		modifier = {
			job_xenomorph_womb_seeding_carrier_add = 100
			job_xenomorph_royal_womb_brood_add = 100
		}
	}

	planet_modifier = {
		logistic_growth_mult = 0.30
		planet_pop_assembly_organic_add = 2
	}

	resources = {
		category = planet_buildings
		cost = { food = 1200 minerals = 400 }
		upkeep = { food = 9 energy = 5 }
	}
}


# === Brood Clutch Incubator: in-species egg production, no slaves. Unlocked via Autogenic Brood "Brood-Layer Fecundity". ===
building_xenomorph_brood_clutch_incubator = {
	icon = building_clone_vats
	base_buildtime = @b1_time
	category = manufacturing
	base_cap_amount = 1
	building_sets = { government urban farming }

	potential = {
		exists = owner
		owner = {
			xeno_is_xenomorph_hive_country = yes
			has_tradition = tr_xenomorph_autogenic_brood_fecundity
		}
		any_owned_pop_group = { is_xenomorph = yes }
	}
	destroy_trigger = {
		exists = owner
		OR = {
			NOT = { owner = { xeno_is_xenomorph_hive_country = yes } }
			NOT = { owner = { has_tradition = tr_xenomorph_autogenic_brood_fecundity } }
		}
	}

	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = yes } }
		modifier = { job_xenomorph_clutch_tender_gestalt_add = 100 }
	}
	triggered_planet_modifier = {
		potential = { owner = { is_gestalt = no } }
		modifier = { job_xenomorph_clutch_tender_add = 100 }
	}

	resources = {
		category = planet_buildings
		cost = { food = 500 minerals = 150 }
		upkeep = { food = 3 energy = 2 }
	}
}
